<?php
/**
 * ===============================================
 * 版权所有 2019-2050 青岛铁锤科技有限公司，并保留所有权利。
 * 网站地址: http://www.huaxianling.com
 * ===============================================
 * Author: Happy dong
 * Created Time: 2019-08-24 16:12
 *
 * Version: 2.0
 */

namespace App\Lib\Message;


use App\Jobs\MessageQueue;
use App\Lib\Notices\JPushNotices;
use Illuminate\Support\Facades\Log;
use JPush\Exceptions\APIRequestException;

class MessageJPush
{

	public static function dispatchMessage($userId,$message=null,$sound='default',$title=null,$content=null){
		try{
			(new JPushNotices())->sendNotice($userId,$message,$sound,$title,$content);
		}catch (APIRequestException $e){
			Log::info('极光推送用户未登录/或不存在：'.$e->getMessage());
		}
	}
}